struct usrapp_net_t
{
	char *name;
	bool host;
	struct vsfip_netif_t netif;
	struct vsfip_ipaddr_t ipaddr;
	struct vsfip_ipaddr_t dns_ip;
	union
	{
		struct vsfip_dhcpd_t dhcpd;
		struct vsfip_dhcpc_t dhcpc;
	};

	struct vsfsm_pt_t pt, caller_pt;
	struct vsfsm_t sm;
};

struct usrapp_t
{
	struct
	{
		struct vsf_usart_stream_t uart_stream;
		struct vsf_fifostream_t stream_tx;
		struct vsf_fifostream_t stream_rx;
		uint8_t txbuff[64 * 1024];
		uint8_t rxbuff[65];
	} debug;

	struct
	{
		struct vsfusbh_t usbh;
		struct vsfohci_hcd_param_t hcd_param;
	} usbh;

	struct
	{
		struct fakefat32_file_t root_dir[7];
		struct fakefat32_param_t param;
	} fakefat32;
	struct
	{
		VSFPOOL_DEFINE(vfsfile_pool, struct vsfile_vfsfile_t, APPCFG_VSFILE_NUM);
		struct vsffat_t fat;

		struct vsfile_t *file;
	} fs;

	struct
	{
		struct
		{
			struct vsfusbd_RNDIS_t param;
		} rndis;
		struct vsfusbd_iface_t ifaces[2];
		struct vsfusbd_config_t config[1];
		struct vsfusbd_device_t device;
	} usbd;

	struct
	{
		struct vsfip_httpd_t httpd;
		struct vsfip_httpd_service_t httpd_services[4];
		struct vsfsm_pt_t pt, caller_pt;
		struct vsfsm_t sm;
	} tcpip;

	struct
	{
		struct usrapp_net_t usbh_ipheth;
		struct usrapp_net_t usbh_ecm;
		struct usrapp_net_t usbd_rndis;
		struct usrapp_net_t usbh_rndis;
	} net;
};

extern struct usrapp_t usrapp;
void usrapp_srt_init(struct usrapp_t *app);
void usrapp_nrt_init(struct usrapp_t *app);
